import request from '@/utils/request'

// 查询房屋业主关系关联列表
export function listOwnerRoom(query) {
  return request({
    url: '/property/ownerRoom/list',
    method: 'get',
    params: query
  })
}

// 查询房屋业主关系关联详细
export function getOwnerRoom(id) {
  return request({
    url: '/property/ownerRoom/' + id,
    method: 'get'
  })
}

// 新增房屋业主关系关联
export function addOwnerRoom(data) {
  return request({
    url: '/property/ownerRoom',
    method: 'post',
    data: data
  })
}

// 修改房屋业主关系关联
export function updateOwnerRoom(data) {
  return request({
    url: '/property/ownerRoom',
    method: 'put',
    data: data
  })
}

// 删除房屋业主关系关联
export function delOwnerRoom(id) {
  return request({
    url: '/property/ownerRoom/' + id,
    method: 'delete'
  })
}

// 导出房屋业主关系关联
export function exportOwnerRoom(query) {
  return request({
    url: '/property/ownerRoom/export',
    method: 'get',
    params: query
  })
}

export function getOwnerByRoomId(roomId) {
  return request({
    url: '/property/ownerRoom/getOwnerByRoomId/'+ roomId,
    method: 'get'
  })
}
